/*
 +-----------------------------------------------------------------------------------------------+
 | Project : UKAPI
 +-----------------------------------------------------------------------------------------------+
 | Project Description : Universal & Kernel API
 +-----------------------------------------------------------------------------------------------+
 | File Description :
 |   Schedulers
 |                                                 
 +-----------------------------------------------------------------------------------------------+
 | Licence : MIT Licence
 +-----------------------------------------------------------------------------------------------+
 | Copyright (c) 2006 Olivier Vanhoucke
 | 
 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
 | and associated documentation files (the "Software"), to deal in the Software without 
 | restriction, including without limitation the rights to use, copy, modify, merge, publish, 
 | distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the 
 | Software is furnished to do so, subject to the following conditions:
 | 
 | The above copyright notice and this permission notice shall be included in all copies or 
 | substantial portions of the Software.
 | 
 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 +-----------------------------------------------------------------------------------------------+
*/

#ifndef __UKAPI_KERNEL_SCHEDULERS__
#define __UKAPI_KERNEL_SCHEDULERS__

#include <clist.h>
#include <dlist.h>
#include <queue.h>
#include <priority_queue.h>
#include <private/task.h>

#include <private/task_manager.h>

typedef struct
{
	list_t list;
} scheduler_tiny_priority_t, * pscheduler_tiny_priority_t;

typedef struct
{
	list_t list;
} scheduler_win32_posix_t, * pscheduler_win32_posix_t;

typedef struct
{
	priority_queue_t	ready_list;
	queue_t				wait_queue;
	queue_t				stop_queue;
} scheduler_priority_list_t, * pscheduler_priority_list_t;

typedef struct
{
	clist_t		ready_list;
} scheduler_round_robin_t, * pscheduler_round_robin_t;

#ifdef __cplusplus
	extern "C" {
#endif /* __cplusplus */

result_t scheduler_win32_posix_init();
result_t scheduler_win32_posix_deinit();
result_t scheduler_win32_posix_add( ptask_t pTask );
result_t scheduler_win32_posix_remove( ptask_t pTask );
void	 scheduler_win32_posix_schedule();

result_t scheduler_tiny_priority_init();
result_t scheduler_tiny_priority_deinit();
result_t scheduler_tiny_priority_add( ptask_t pTask );
result_t scheduler_tiny_priority_remove( ptask_t pTask );
void	 scheduler_tiny_priority_schedule();

#ifdef __cplusplus
	}
#endif /* __cplusplus */

#endif /* __UKAPI_KERNEL_SCHEDULERS__ */
